home *** CD-ROM | disk | FTP | other *** search
- % This sample shows how to
- % - create two Integer-Objects
- % - calculate their values into a third object
- % - show the result of the addition "on the fly"
- % All calculations are done in floating point and written to the
- % VAR-Elements in their respective VAR-Format
-
- Malloc(90); %Get memory
- @xbwstart(("simple-project") ("bw")); %Setup xbw system in "bw"/"color"
- wdw(TEST 3 4 20 11 StandardWDW);
- % VAR-PARAMETERS:
- o(TEST1 I I 2 3 15 1 Standard); bg(TEST1 . 100 ); eg(); % 100
- o(TEST2 I I 2 4 15 1 Standard); bg(TEST2 . 55 ); eg(); % 55
- o(TEST3 D D 2 7 15 1 Standard);
- bg(TEST3 . 0.00001 ); ff( ("%12.7f") ("") 1.0 ); eg(); % 0.00001
-
- % CALCULATE; this calculation runs only once (because it's in this macro file!)
- % Just move it into an object action, and it runs every time the object acts!
-
- ?("First VAR-PARAMETER: "); ?(int)OBJ:TEST1.V;
- ?("Second VAR-PARAMETER:"); ?(int)OBJ:TEST2.V;
- ?("Division Result:");
- #a:=(int)OBJ:TEST1.V / (int)OBJ:TEST2.V; ?(#a); % creating a temp.variable
- ?("Now putting the result in object TEST3"); (dbl)OBJ:TEST3.V := (#a);
-
- o(TEST4 S . 2 9 15 1 Secure);
- bg(TEST4 . (" Exit"));
- cn(raK("@stop();"));
- eg();
- Message(("Project Complete.")); %That's it!
- End();
-
-